package com.etoak.api;

import com.etoak.common.core.vo.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 远程调用接口
 */
@FeignClient("upload-service")
public interface UploadService {

    /**
     * 声明远程图片上传接口
     * 1、@PostMapping 必须提供 consumes 属性，它的值必须是 multipart/form-data
     * 2、MultipartFile 参数前必须添加 @RequestPart 注解
     * @param image
     * @return
     */
    @PostMapping(value = "/upload/img", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultVO<String> upload(@RequestPart MultipartFile image);
}
